# Auth mod for Minetest

This is a simple mod that allows a Minetest server to store player authentication data in a PostgreSQL or SQLite3 database.

## Getting Started

Download and install in the world folder under worldmods/auth. It will automatically use the pgsql_connection string to connect to the backend database server. It will automatically create the required table mod_auth if permissions allow. Otherwise it will not work.

## Features

Automotically picks up PostgreSQL connection string from the world.mt file.

Will automatically import records from any legacy auth.txt file found in the world folder.

Caches records up-to-date copies of records in memory and only reads or writes to the database when needed.

Automatical garbage collection that removes stale cache records every 3600 seconds(1 hour).

### Prerequisites

The mtm mod is required for simple and easy access to the backend database. The mtm mod must be installed as a trusted mod. It uses lua packages installed at the operating system level to connect to PostgreSQL or SQLite3. The API to the database is a package called dbtable, which allows key/value tables to appear as a simple lua table with a few minor differences.

## Authors

James Dornan

## License

This project is licensed under the GPLv3 - see the [LICENSE](LICENSE) file for details

